﻿@using NewLife.Common;
@{
    var user = ViewBag.User as IUser ?? User.Identity as IUser;
}
<div class="btn-group">
    <button data-toggle="dropdown" class="btn btn-info btn-sm btn-sm-force dropdown-toggle" aria-expanded="false">
        高级
        <span class="ace-icon fa fa-caret-down icon-on-right"></span>
    </button>

    <ul class="dropdown-menu dropdown-info dropdown-menu-right">
        <li>
            <a href="@Url.Action("ExportExcel")">导出Excel</a>
        </li>
        <li>
            <a href="@Url.Action("ExportXml")">导出Xml</a>
        </li>
        @*<li>
                <a href="@Url.Action("ImportXml")">导入Xml</a>
            </li>*@
        <li>
            <a href="@Url.Action("ExportJson")">导出Json</a>
        </li>
        @*<li>
                <a href="@Url.Action("ImportJson")">导入Json</a>
            </li>*@
        @if (this.Has(PermissionFlags.Delete))
        {
            <li class="divider"></li>
            <li>
                <a href="@Url.Action("DeleteSelect")" data-action="action" data-fields="keys" data-confirm="该操作将删除选中数据并不可恢复！确认删除？" title="删除选中数据">删除选中</a>
            </li>
            <li>
                <a href="@Url.Action("DeleteAll")" data-action="action" data-confirm="该操作将删除当前查询的所有数据并不可恢复！确认删除？" title="删除当前查询的所有数据">删除全部</a>
            </li>
        }
        @if (SysConfig.Current.Develop)
        {
            <li class="divider"></li>
            if (User.IsInRole("管理员"))
            {
                <li>
                    <a href="@Url.Action("Clear")" data-action="action" data-confirm="该操作将删除数据表所有数据并不可恢复！确认清空？" title="删除数据表所有数据">清空数据表</a>
                </li>
            }
            if (ViewHelper.IsDevelop())
            {
                <li>
                    <a href="@Url.Action("MakeList")">生成列表</a>
                </li>
                <li>
                    <a href="@Url.Action("MakeForm")">生成表单</a>
                </li>
            }
        }
    </ul>
</div><!-- /.btn-group -->